package file;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

public class Demo2 {

	public static void main(String[] args) {
		File f=new File("e:\\abc.txt");
		try{
			InputStreamReader isr=
					new InputStreamReader(
					new FileInputStream(f),"UTF-8");
			//int a;
			int c;
			char[] tmp=new char[5];
			while((c=isr.read(tmp))!=-1){
				for(int i=0;i<c;i++){
				System.out.print(tmp[i]);
			}}
			/*while((a=isr.read())!=-1){
				System.out.print((char)a+"\t");
			}*/
				} catch (UnsupportedEncodingException e) {
					// TODO: handle exception
					e.printStackTrace();
				
			}catch (Exception e){
		}
	}
}

